import request from '@/utils/request'

// 查询采集商品;参考AE-商品：发布产品信息（aliexpress.postproduct.redefining.postaeproduct）列表
export function listCollectProduct(query) {
  return request({
    url: '/gather/gather/collectProduct/list',
    method: 'get',
    params: query
  })
}

// 获取2.0产品库产品列表
export function queryProduct2List(query) {
  return request({
    url: '/gather/gather/collectProduct/list',
    method: 'get',
    params: query
  })
}

// 查询采集商品;参考AE-商品：发布产品信息（aliexpress.postproduct.redefining.postaeproduct）详细
export function getCollectProduct(id) {
  return request({
    url: '/gather/gather/collectProduct/' + id,
    method: 'get'
  })
}

// 新增采集商品;参考AE-商品：发布产品信息（aliexpress.postproduct.redefining.postaeproduct）
export function addCollectProduct(data) {
  return request({
    url: '/gather/gather/collectProduct',
    method: 'post',
    data: data
  })
}

// 修改采集商品;参考AE-商品：发布产品信息（aliexpress.postproduct.redefining.postaeproduct）
export function updateCollectProduct(data) {
  return request({
    url: '/gather/gather/collectProduct',
    method: 'put',
    data: data
  })
}

// 暂存采集商品
export function stagingCollectProduct(data) {
  return request({
    url: '/gather/gather/collectProduct/staging',
    method: 'post',
    data: data
  })
}

// 删除采集商品;参考AE-商品：发布产品信息（aliexpress.postproduct.redefining.postaeproduct）
export function delCollectProduct(id) {
  return request({
    url: '/gather/gather/collectProduct/' + id,
    method: 'delete'
  })
}

// 新增规格名
export function addcollectProductSkuProperty(data) {
  return request({
    url: '/gather/gather/collectProductSkuProperty',
    method: 'post',
    data: data
  })
}

// 新增规格值
export function addCollectProductSkuProValue(data) {
  return request({
    url: '/gather/gather/collectProductSkuProValue',
    method: 'post',
    data: data
  })
}

// 获取商品标签的选择列表
export function getSelect() {
  return request({
    url: '/gather/gather/productClassify/getSelectList',
    method: 'get'
  })
}


// 获取运费试算国家列表
export function getCountryList() {
  return request({
    url: '/freight/gather/productFreight/getCountryList',
    method: 'get'
  })
}


// 运费试算
export function calculateFreight(data) {
  return request({
    url: '/freight/gather/productFreight/calculateFreight',
    method: 'post',
    data: data
  })
}

// 获取品牌选择列表
export function getBrand() {
  return request({
    url: '/gather/gather/productBrand/selectList',
    method: 'get'
  })
}

// 根据店铺id获取品牌选择列表
export function getBrandListByStoreId(query) {
  return request({
    url: '/shop/seller/storeCategoryBrand/getBrandList',
    method: 'get'
  })
}

// 获取店铺列表
export function getStore() {
  return request({
    url: '/shop/seller/storeCategoryBrand/getEmpowerList',
    method: 'get'
  })
}


// 商品刊登
export function collectProductPublish(query) {
  return request({
    url: '/gather/gather/collectProduct/publish',
    method: 'get',
    params: query
  })
}

// 忽略翻译
export function ignoreTranslateTask(id) {
  return request({
    url: '/gather/gather/collectProduct/ignoreTranslation?productId=' + id,
    method: 'get'
  })
}

// 商品属性
export function categoryInfo(id) {
  return request({
    url: '/gather/aliexpress/category/getCategoryInfoById?id=' + id,
    method: 'get'
  })
}

// 获取详情的关键词
export function extractDescription(query) {
  return request({
    url: '/gather/gather/chatgpt/extractDescription',
    method: 'get',
    params: query
  })
}

// 获取标题的关键词
export function extractKeyWords(query) {
  return request({
    url: '/gather/gather/chatgpt/extractKeyWords',
    method: 'get',
    params: query
  })
}

// 详情页翻译
export function translate(query) {
  return request({
    url: '/gather/gather/chatgpt/translate',
    method: 'post',
    data: query
  })
}

// 根据标题关键词生成标题
export function createTitle(query) {
  return request({
    url: '/gather/gather/chatgpt/createTitle',
    method: 'get',
    params: query
  })
}

// 根据详情关键词生成详情
export function createProductDescription(query) {
  return request({
    url: '/gather/gather/chatgpt/createProductDescription',
    method: 'get',
    params: query
  })
}

// 修复下架商品
export function repairProductTakedown(query) {
  return request({
    url: '/gather/gather/productUnifiedTakedown/repairProductTakedown',
    method: 'get',
    params: query
  })
}

// f复制
export function copyProd(query) {
  return request({
    url: '/gather/gather/collectProduct/copyProd',
    method: 'get',
    params: query
  })
}

// 规格合并
export function updateCateGoryProById(query) {
  return request({
    url: '/gather/gather/collectProduct/updateCateGoryProById',
    method: 'get',
    params: query
  })
}

// 新版下架
export function soldOutCollectProduct(query) {
  return request({
    url: '/gather/gather/collectProduct/batchSoldOutCollectProduct',
    method: 'get',
    params: query
  })
}

// 新版批量上架
export function batchGrounding(query) {
  return request({
    url: '/gather/gather/collectProduct/batchGrounding',
    method: 'get',
    params: query
  })
}

